package cn.wolfcode.rbac;

import cn.wolfcode.domain.Room;
import cn.wolfcode.domain.Student;
import cn.wolfcode.mapper.DepartmentMapper;
import cn.wolfcode.service.IDepartmentService;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.transaction.TransactionManager;

import javax.sql.DataSource;

@SpringBootTest
class RbacApplicationTe {

    @Autowired
    private DataSource dataSource;

    @Autowired
    private SqlSessionFactory sqlSessionFactory;

    @Autowired
    private DepartmentMapper departmentMapper;

    @Autowired
    private TransactionManager transactionManager;

    @Autowired
    private IDepartmentService departmentService;
    @Test
    void contextLoads() {
//        System.out.println(dataSource.getClass());
//        System.out.println(dataSource == null);
//        System.out.println(sqlSessionFactory);
//        System.out.println(departmentMapper.getClass());
//        System.out.println(departmentMapper.selectAll());
//        System.out.println(transactionManager);
        System.out.println(departmentService.getClass());

    }

    @Test
    public void studentTest() {
        Student student = new Student();
        student.setRoom(new Room());
        student.getRoom().setId(3l);
        student.setId(1l);
        System.out.println("***************");
        System.out.println(student.toString());

    }

}
